package com.zzyweb.rentalcarsys.entity;

import com.baomidou.mybatisplus.annotation.*;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author zhiyi
 * @date 9/29/25
 **/
@TableName("user_account")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserAccount {
    @TableId(type = IdType.AUTO)
    private Long id;
    @NotEmpty(message = "用户不能为空")
    @Size(min = 3, max = 15,message = "用户名长度不合规")
    private String username;
    @Size(min = 3, message = "密码长度不合规")
    @NotEmpty(message = "密码不能为空")
    private String password;
    @Email(message = "邮箱格式不正确")
    private String email;
    private String phoneNumber;
    @TableLogic(delval = "1", value = "0")
    private Integer isDelete;
    @TableField(exist = false)
    private List<Role> roles;
}
